<aside class="lg-side">
  <div class="panel-heading tab-bg-dark-navy-blue okr-tab-head tab-right "></div>
  <div class="inbox-body mi-h8">
    <div class="row">
      <div class="col-lg-12 hidebox" id="telbox">
        <section class="panel">
          <header class="panel-heading">
            联系人信息
          </header>
          <div class="panel-body">
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">联系人名称*</label>
              <div class="col-sm-10">
                <input type="text" id="cusName" class="form-control" maxlength="50" placeholder="最多50个字" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');">
              </div>
            </div>
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">联系方式*</label>
              <div class="col-sm-10">
                <input type="text" id="phone" class="form-control" onblur="telNo(this.id)" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');">
              </div>
            </div>
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">邮件地址*</label>
              <div class="col-sm-10">
                <input type="text" id="email" class="form-control" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');">
              </div>
            </div>
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">注释</label>
              <div class="col-sm-10">
                <textarea class="form-control" id="backDesc" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');" maxlength="120"
                  placeholder="字数限制(120字以内)"></textarea>
              </div>
            </div>
            <p class="default-buttons">
              <a href="javascript:void(0);" class="button-back btn btn-info" onclick="toBack()">返回</a>
              <a href="javascript:void(0);" class="button-next  btn btn-info add">提交</a>
            </p>
          </div>
        </section>
      </div>
    </div>
  </div>
</aside>
<script>
  function addLxr($certusUtils, id) {
    $(".add").on('click', function () {
      var data = {};
      data.telePhone = $("#phone").val();
      data.cusName = $("#cusName").val();
      data.email = $("#email").val();
      if (data.cusName == "" || data.cusName == null || data.cusName == undefined) {
        layer.msg("联系人名称不能为空！");
        return;
      }
      if (data.telePhone == "" || data.telePhone == null || data.telePhone == undefined) {
        layer.msg("联系方式不能为空！");
        return;
      }
      if (data.email == "" || data.email == null || data.email == undefined) {
        layer.msg("邮件地址不能为空！");
        return;
      }
      data.cusDesc = $("#backDesc").val();
      data.comId = id;
      $certusUtils.ajax("addLxr", {
        "data": JSON.stringify(data),
          "projId":proId
      }, function (response) {
        layer.msg("添加成功");
        toLoadHtml(5);
      })
    })
  }

  function toBack() {
    toLoadHtml(5);
  }
</script>